package com.cxcy.swustlearner.mapper;

import com.cxcy.swustlearner.pojo.TaskStatus;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface TaskStatusMapper {
    @Insert("insert into task_status (task_id, uid) values (#{taskId},#{uid})")
     void insertTaskStatus(String taskId, String uid);
    @Update("update task_status set completed_status=#{completedStatus} where task_id =#{taskId} and uid=#{uid}")
    void updateTaskStatus(TaskStatus taskStatus);
    @Select("select * from task_status where task_id=#{taskId} and completed_status =#{completedStatus}")
    List<TaskStatus> getTaskStatus(String taskId, int completedStatus);
}